<main class="lyear-layout-content">
      
    <div class="container-fluid p-t-15">
      
      <div class="row">
        <div class="col-lg-6">
          <div class="card">
            <div class="card-header"><h4>性别</h4></div>
            <div class="card-body">
              <canvas id="chart-pie" width="280" height="280"></canvas>
            </div>
          </div>
        </div>
        <div class="col-lg-6">
          <div class="card">
            <div class="card-header"><h4>认证状态</h4></div>
            <div class="card-body">
              <canvas id="chart-doughnut" width="280" height="280"></canvas>
            </div>
          </div>
        </div>
      </div>
      
    </div>
    
  </main>
  
  <script type="text/javascript" src="/static/admin/js/Chart.min.js"></script>
  <script type="text/javascript">
    $.ajax({
      url:`{:url('admin/analysis/user')}`,
      type:'post',
      data:{action:'pie'},
      dataType:'json',
      success:function(success)
      {
        var sex = success.data.sex
        var auth = success.data.auth
  
        new Chart($("#chart-pie"), {
            type: 'pie',
            data: {
                labels: ["男", "女", "保密"],
                datasets: [{
                    data: sex,
                    backgroundColor: ['rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)']
                }]
            },
            options: {
                responsive: false
            }
        });
  
        new Chart($("#chart-doughnut"), {
            type: 'doughnut',
            data: {
                labels: ["已认证", "未认证"],
                datasets: [{
                    data: auth,
                    backgroundColor: ['rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)']
                }]
            },
            options: {
                responsive: false
            }
        });
  
      }
    })
  
  
  </script>